import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: 'backend_sale_list',
    method: 'get',
    params: query
  })
}

export function fetchSale(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function deleteSale(data) {
  return request({
    url: '/sale/delete/' + data,
    method: 'delete'
  })
}

export function createSale(data) {
  return request({
    url: 'backend_sale_create',
    method: 'post',
    data
  })
}

export function updateSale(data) {
  return request({
    url: '/sale/update',
    method: 'put',
    data
  })
}

export function updateSaleStatus(data) {
  return request({
    url: 'backend_sale_updateStatus',
    method: 'put',
    data
  })
}
export function resetPwd(data) {
  return request({
    url: 'backend_sale_reset_password',
    method: 'post',
    data
  })
}
